<?php require_once('../Connections/sepolwan_connect.php'); ?>
<?php
//initialize the session
if (!isset($_SESSION)) {
  session_start();
}

// ** Logout the current user. **
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
  $logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
  //to fully log out a visitor we need to clear the session varialbles
  $_SESSION['sesi_nama'] = NULL;
  $_SESSION['MM_UserGroup'] = NULL;
  $_SESSION['PrevUrl'] = NULL;
  unset($_SESSION['sesi_nama']);
  unset($_SESSION['MM_UserGroup']);
  unset($_SESSION['PrevUrl']);
	
  $logoutGoTo = "index.php?stat=logout_success";
  if ($logoutGoTo) {
    header("Location: $logoutGoTo");
    exit;
  }
}
?>
<?php
if (!isset($_SESSION)) {
  session_start();
}
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";

// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) { 
  // For security, start by assuming the visitor is NOT authorized. 
  $isValid = False; 

  // When a visitor has logged into this site, the Session variable sesi_nama set equal to their username. 
  // Therefore, we know that a user is NOT logged in if that Session variable is blank. 
  if (!empty($UserName)) { 
    // Besides being logged in, you may restrict access to only certain users based on an ID established when they login. 
    // Parse the strings into arrays. 
    $arrUsers = Explode(",", $strUsers); 
    $arrGroups = Explode(",", $strGroups); 
    if (in_array($UserName, $arrUsers)) { 
      $isValid = true; 
    } 
    // Or, you may restrict access to only certain users based on their username. 
    if (in_array($UserGroup, $arrGroups)) { 
      $isValid = true; 
    } 
    if (($strUsers == "") && true) { 
      $isValid = true; 
    } 
  } 
  return $isValid; 
}

$MM_restrictGoTo = "index.php?stat=login_heula";
if (!((isset($_SESSION['sesi_nama'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['sesi_nama'], $_SESSION['MM_UserGroup'])))) {   
  $MM_qsChar = "?";
  $MM_referrer = $_SERVER['PHP_SELF'];
  if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
  if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0) 
  $MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
  $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
  header("Location: ". $MM_restrictGoTo); 
  exit;
}
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$colname_nama = "-1";
if (isset($_SESSION['sesi_nama'])) {
  $colname_nama = $_SESSION['sesi_nama'];
}
mysql_select_db($database_sepolwan_connect, $sepolwan_connect);
$query_nama = sprintf("SELECT * FROM login WHERE nama = %s", GetSQLValueString($colname_nama, "text"));
$nama = mysql_query($query_nama, $sepolwan_connect) or die(mysql_error());
$row_nama = mysql_fetch_assoc($nama);
$totalRows_nama = mysql_num_rows($nama);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
body {
	background:url(bg.png) right repeat-y #f3f3f3;
	height: 100%;
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
body,button,input,select,textarea{font:12px/1.5 tahoma,arial,\5b8b\4f53; color: #333;}
input,select,textarea{font-size:100%;}
input,select{vertical-align:baseline;}
table{border-collapse:collapse;border-spacing:0;}
th{text-align:inherit;}
fieldset,img{border:0;}
iframe{display:block;}
abbr,acronym{border:0;font-variant:normal;}
del{text-decoration:line-through;}
address,caption,cite,code,dfn,em,th,var{font-style:normal;font-weight:500;}
caption,th{text-align:left;}
h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:500;}
q:before,q:after{content:'';}
sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}
sup{top:-0.5em;}
sub{bottom:-0.25em;}
a{color: #060;}
a:hover{text-decoration:none; color: #F00;}
ins,a{text-decoration:none;}
.menu{border-top:2px dotted #CCCCCC; padding:10px; -webkit-transition: All 0.5s ease; -moz-transition: All 0.5s ease; -o-transition: All 0.5s ease; -ms-transition: All 0.5s ease; transition: All 0.5s ease;}
.menu:hover{padding:10px 10px 10px 30px; background-color:#F00; color:#FFF; -webkit-transition: All 0.5s ease; -moz-transition: All 0.5s ease; -o-transition: All 0.5s ease; -ms-transition: All 0.5s ease; transition: All 0.5s ease;}
#tambahan {
	background-image: -webkit-gradient(linear, left top, left bottom, from(#666), to(#000));
	background-image: -webkit-linear-gradient(top, #666, #000);
	background-image: -moz-linear-gradient(top, #666, #000); 
   	background-image: -ms-linear-gradient(top, #666, #000); 
  	background-image: -o-linear-gradient(top, #666, #000); 
   	background-image: linear-gradient(to bottom, #666, #000);
	width:100px;
	color:#FFF;
	font-weight:bold;
	bottom:80px;
	position:fixed;
	padding:10px;
	border-radius:0px 30px 30px 0px;
	-webkit-transition: All 0.5s ease; 
	-moz-transition: All 0.5s ease; 
	-o-transition: All 0.5s ease; 
	-ms-transition: All 0.5s ease; 
	transition: All 0.5s ease;
}
#tambahan:hover {
	width:140px;
	padding-left:40px;
	color: #FF0;
}
#tambahan2{border-top:2px dotted #CCCCCC; padding:10px; width:100%; bottom:8px;
	position:fixed; }
</style>
<script type="text/javascript">

function popup(){
  cuteLittleWindow = window.open("imagefile.php", "littleWindow", "location=no,width=300,height=600"); 
}

</script>
</head>

<body>
<div align="center"><br />
Hallo <?php echo $row_nama['nama']; ?> |<a href="<?php echo $logoutAction ?>" target="_parent"> log out</a> !!<br />
<br />
</div>
<a href="artikel.php?jenis=Adobe-Photoshop" target="mainFrame"><div class="menu">Adobe Photoshop</div></a>
<a href="artikel.php?jenis=Adobe-Ilustrator" target="mainFrame"><div class="menu">Adobe Ilustrator</div></a>
<a href="artikel.php?jenis=CorelDraw" target="mainFrame"><div class="menu">CorelDraw</div></a>
<a href="artikel.php?jenis=Tutorial-Web-Development" target="mainFrame"><div class="menu">Tutorial Web Development</div></a>
<a href="artikel.php?jenis=Adobe-Flash" target="mainFrame"><div class="menu">Adobe Flash</div></a>
<a href="artikel.php?jenis=SwishMax" target="mainFrame"><div class="menu">SwishMax</div></a>
<a href="artikel.php?jenis=News" target="mainFrame"><div class="menu">News</div></a>
<a href="artikel.php?jenis=Tips-And-Tricks" target="mainFrame"><div class="menu">Tips And Tricks</div></a>
<a href="artikel.php?jenis=Download" target="mainFrame"><div class="menu">Download</div></a>
<a href="komentar.php" target="mainFrame"><div class="menu">Komentar</div></a>

<a href="javascript:popup()" ><div id="tambahan" >Image File</div></a>
<div id="tambahan2" ><div style="margin-bottom:5px">Ada yang bisa di bantu ?</div>
<a target="_blank" href="http://ymgen.com/chat.php?idne=riswandwicahya"><img border="0" src="http://opi.yahoo.com/online?u=riswandwicahya&amp;m=g&amp;t=1" /></a> <a href="http://www.facebook.com/Wans.jamers" target="_blank"><img src="FXHC9IQ-JIj.ico" width="16" height="16" /></a> <a href="https://twitter.com/RD_Cahya24" target="_blank"><img src="favicon.ico" width="16" height="16" /></a></div>
</body>
</html>
<?php
mysql_free_result($nama);
?>
